<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.dao.CommonDAO"%>
<%@page import="com.util.Info"%>
<%@page import="com.model.Sysuser"%>
<%@page import="com.model.Familyda"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户注册</title>
<!-- 调用CSS，JS -->
<link href="/wearablehealthymonitorsys/admin/images/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-family: "宋体";
	font-size: 12px;
	color: #333333;
	background-color: ;
}
.STYLE1 {
	color: #333333;
	font-size: x-large;
	font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
<script language="javascript">
function window.onload() { 

if(top.location != self.location){ 

var a = window.parent.document.getElementsByTagName('iframe'); 

for (var i=0; i<a.length; i++){ 

if (a[i].name == self.name) {a[i].height = document.body.scrollHeight+320; return;}}} 
} 
</script>
<script language=javascript>
function show(no)
{
for(var i=1;i<20;i++)
{
var a = document.getElementById(no+"@"+i);
if(a==null)
{
continue;
}
if(a.style.display=="")
{
a.style.display="none";
}else{
a.style.display="";
}
}

}
</script>
<script type="text/javascript">
function showzhi(inn)
{
var a = document.getElementById("loca");
a.innerHTML=inn;
}
function change(no)
{
var c = document.getElementById("c");
c.innerHTML=no;
}
</script>

</head>
<body>
<%
  CommonDAO dao = (CommonDAO)Info.getDao(request,"CommonDAO");
  String id = request.getParameter("id");
  if(id==null)id = (String)request.getAttribute("id");
  Familyda familyda = (Familyda)dao.findById(id,"Familyda");
   %>
					<form  name="f1" method="post" action="FamilydaEdit.action?id=<%=id %>" onsubmit="return ck()">
						<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BBD3EB">
							<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">户主名称</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<input type="text" id="hz" name="hz" value="<%=familyda.getHz() %>"/></td>
    						</tr>
    						<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">家庭类型</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;
                            		<select id="ftype" name="ftype">
										<option value="">请选择</option>
										<option value="核心家庭" <%if(familyda.getFtype().equals("核心家庭")){out.print("selected==selected");} %>>核心家庭</option>
										<option value="主干家庭" <%if(familyda.getFtype().equals("主干家庭")){out.print("selected==selected");} %>>主干家庭</option>
										<option value="联合家庭" <%if(familyda.getFtype().equals("联合家庭")){out.print("selected==selected");} %>>联合家庭</option>
										<option value="单亲家庭" <%if(familyda.getFtype().equals("单亲家庭")){out.print("selected==selected");} %>>单亲家庭</option>
										<option value="重组家庭" <%if(familyda.getFtype().equals("重组家庭")){out.print("selected==selected");} %>>重组家庭</option>
										<option value="丁克家庭" <%if(familyda.getFtype().equals("丁克家庭")){out.print("selected==selected");} %>>丁克家庭</option>
									</select>
                            	</td>
    						</tr>
                          	<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">地址</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<input type="text" id="addr" name="addr" value="<%=familyda.getAddr() %>" size="50"/></td>
    						</tr>
                         	<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">责任医生</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;
                            		<select id="ysid" name="ysid">
										<option value="">请选择</option>
										<%ArrayList<Sysuser> yslist = (ArrayList<Sysuser>)dao.findByHql(" from Sysuser where utype='医生' and delstatus='0'"); 
										for(Sysuser ys:yslist){%>
										<option value="<%=ys.getId() %>" <%if(familyda.getYsid().equals(ys.getId().toString())){out.print("selected==selected");} %>><%=ys.getTname() %></option>
										<%} %>
									</select>
									
								</td>
    						</tr>
                         	<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">责任护工</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;
                            		<select id="hgid" name="hgid">
										<option value="">请选择</option>
										<%ArrayList<Sysuser> hglist = (ArrayList<Sysuser>)dao.findByHql(" from Sysuser where utype='护工' and delstatus='0'"); 
										for(Sysuser hg:hglist){%>
										<option value="<%=hg.getId() %>" <%if(familyda.getHgid().equals(hg.getId().toString())){out.print("selected==selected");} %>><%=hg.getTname() %></option>
										<%} %>
									</select>
									
								</td>
    						</tr>
                      		<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">管理机构</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<input type="text" id="unit" name="unit" value="<%=familyda.getUnit() %>"/></td>
    						</tr>
    						<tr>
                            	<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">备注</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<textarea rows="5" cols="50" id="remark" name="remark"><%=familyda.getRemark() %></textarea> </td>
    						</tr>
    						
    						<tr>
    							<td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF"></td>
    							<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<input type="submit" value="提交"/><input type="reset" value="重置"/></td>
    						</tr>
                            <script language="javascript">
                            function ck(){
                            	if(f1.hz.value==""){
                            		alert("户主不能为空");
                            		return false;
                            	}if(f1.ftype.value==""){
                            		alert("家庭类型不能为空");
                            		return false;
                            	}if(f1.addr.value==""){
                            		alert("地址不能为空");
                            		return false;
                            	}if(f1.ysid.value==""){
                            		alert("责任医生不能为空");
                            		return false;
                            	}if(f1.hgid.value==""){
                            		alert("责任护工不能为空");
                            		return false;
                            	}if(f1.unit.value==""){
                            		alert("管理机构不能为空");
                            		return false;
                            	}
                            }

<%
String no = (String)request.getAttribute("no");
String suc = (String)request.getAttribute("suc");
if(no!=null)
{
 %>
 alert("");

 <%}
if(suc!=null)
{
 %>
 alert("操作成功");
location.replace("/wearablehealthymonitorsys/admin/familydagl.jsp");
 <%}%>
                            </script>
</table>      
</form>                 
</body>
</html>
